﻿using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web.UI.WebControls;
using ConsolidationTool.Common;

namespace ConsolidationTool.WebParts.Layouts.CReport
{
    public partial class DirectCashReport : FSReportBase
    {

        public override ControlTemplates.CommonEntitySelector TopSelector
        {
            get
            {
                return commonEntitySelector as ControlTemplates.CommonEntitySelector;
            }
        }

        public override Repeater BaseReport
        {
            get
            {
                return EQRepeater;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
        }

        public override void GenerateReport_Click(object sender, EventArgs e)
        {
            RepHeader.ItemDataBound += new RepeaterItemEventHandler(RepHeader_ItemDataBound);
        }

        void RepHeader_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var dataItem = e.Item.DataItem as ARTTableRow;
            Repeater rep = e.Item.FindControl("RPValue") as Repeater;
            rep.DataSource = dataItem.fields;
            rep.DataBind();
        }
      
    }
}
